<!--
 * @Author: 陈俊升 761723995@qq.com
 * @Date: 2023-05-27 08:58:26
 * @LastEditors: 陈俊升 761723995@qq.com
 * @LastEditTime: 2023-10-19 17:08:43
 * @FilePath: /hr_new_vue3/src/views/Management/Organization/PositionManagement/SystemManagement/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 组织-职位管理-标准职位体系管理页面 -->
<template>
  <ContentCard>
    <template #header>
      <PageHeaderNew :title="title" :breadCrumb="breadCrumb"> </PageHeaderNew>
    </template>
    <a-tabs default-active-key="1">
      <a-tab-pane key="1" title="职位管理">
        <Management></Management>
      </a-tab-pane>
      <a-tab-pane key="2" title="职位体系矩阵">
        <Matrix
          @init="getSortData"
          :columns-data="columns.data"
          :datas="data.data"
          :table-datas="matrixTableData.data"
        ></Matrix>
      </a-tab-pane>
      <a-tab-pane key="3" title="职业发展通道">
        <Development
          :columns-data="columns.data"
          :datas="data.data"
          :table-datas="developmentTableData.data"
        >
        </Development>
      </a-tab-pane>
    </a-tabs>
  </ContentCard>
</template>

<script lang="ts" setup>
import Management from './Components/Management/index.vue';
import Matrix from './Components/Matrix/index.vue';
import Development from './Components/Development/index.vue';
import {
  getPositionHierarchyList,
  getPositionSortList,
  GetPositionSystem,
  GetPositionDevelopment,
  PutPositionSystem,
  PostPositionSystem
} from '@/apis/management/organization/baseSetting/PositionSystem/index';

const title = '职位体系管理';

const breadCrumb: string[] = ['组织', '职位管理', '职位体系管理'];

const router = useRouter();

const columns = reactive({ data: [] });
const data: any = reactive({ data: [] });
const matrixTableData: any = reactive({ data: [] });
const developmentTableData: any = reactive({ data: [] });

const getSortData = async () => {
  try {
    const positionSortList = await getPositionSortList();
    const positionHierarchyList = await getPositionHierarchyList({
      pageNumber: 0,
      pageSize: -1
    });
    const positionSystem = await GetPositionSystem();
    const positionDevelopment = await GetPositionDevelopment();

    columns.data = positionSortList.positionCategoryList;
    data.data = positionHierarchyList;
    matrixTableData.data = positionSystem;
    developmentTableData.data = positionSystem;

    // return Promise.resolve(positionSortList.positionCategoryList);
  } catch (error) {
    console.error(error);
  }
};
getSortData();
</script>

<style lang="less" scoped></style>
